This invention relates to an image processing apparatus and method for processing image data having index data, and to a computer-readable memory storing the program code for this processing.
In an image processing apparatus for forming multivalued images, a white balance adjustment is performed for the purpose of obtaining an image having sharp contrast by adjusting the luminance values of highlight portions, which are the brightest portions of an image, and of shadow portions, which are the darkest portions of an image.
When a white balance adjustment is performed in a conventional image processing apparatus, the average values of R, G, B of pixels with the exception of pixels whose luminance is greater than a predetermined threshold value are calculated in a prescribed high-luminance area in which the luminance of the image ranges from the high luminance value to several percent of the high luminance value, and each pixel is corrected on the basis of each of the average values.
In the conventional image processing apparatus described above, however, processing can be applied only to a full-color image in which the R, G, B values are given for each and every pixel of the image data. As a consequence, processing cannot be executed in regard to an image having index data in which the image data itself is represented by index values.
Accordingly, an object of the present invention is to provide an image processing apparatus, method and computer-readable memory which make it possible to execute the processing of image data appropriately and at high speed in conformity with the content of the image data.
According to the present invention, the foregoing object is attained by providing an image processing apparatus for processing an image, comprising: discrimination means for discriminating, on the basis of an image header of an input image, whether the input image is an image having a plurality of color components or an image having index data; and correction means for correcting the input image based upon results of discrimination by the discrimination means.
According to another aspect of the present invention, the foregoing object is attained by providing an image processing apparatus for processing image data having index data, comprising: creating means for creating a histogram from the image data and its index data; highlight calculation means for calculating highlight-area information of the image data based upon the histogram; white-balance calculation means for calculating white-balance information of the image data based upon the histogram; and correction means for correcting the index data based upon the highlight-area information and white-balance information.
According to the present invention, the foregoing object is attained by providing an image processing method for processing an image, comprising: a discrimination step of discriminating, on the basis of an image header of an input image, whether the input image is an image having a plurality of color components or an image having index data; and a correction step of correcting the input image based upon results of discrimination at the discrimination step.
According to another aspect of the present invention, the foregoing object is attained by providing an image processing method for processing image data having index data, comprising: a creating step of creating a histogram from the image data and its index data; a highlight calculation step of calculating highlight-area information of the image data based upon the histogram; a white-balance calculation step of calculating white-balance information of the image data based upon the histogram; and a correction step of correcting the index data based upon the highlight-area information and white-balance information.
According to the present invention, the foregoing object is attained by providing a computer-readable memory storing program code of image processing for processing an image, the memory including: program code of a discrimination step of discriminating, on the basis of an image header of an input image, whether the input image is an image having a plurality of color components or an image having index data; and program code of a correction step of correcting the input image based upon results of discrimination at the discrimination step.
According to another aspect of the present invention, the foregoing object is attained by providing a computer-readable memory storing program code of image processing for processing image data having index data, comprising: program code of a creating step of creating a histogram from the image data and its index data; program code of a highlight calculation step of calculating highlight-area information of the image data based upon the histogram; program code of a white-balance calculation step of calculating white-balance information of the image data based upon the histogram; and program code of a correction step of correcting the index data based upon the highlight-area information and white-balance information.